import unittest
import os
import time

import HTMLTestRunner
# 存放测试报告的路径
report_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# 测试报告文件名
html_report_filename = time.strftime('front-register %Y-%m-%d-%H-%M-%S') + 'Report.html'
# 最终生成测试报告文件的路径
html_report_path = os.path.join(report_path,'report/', html_report_filename)
# 测试套件
loader = unittest.defaultTestLoader.discover('../case/front', 'test_reverse_register2.py')

with open(html_report_path, 'wb') as f:
    runner = HTMLTestRunner.HTMLTestRunner(
        title='注册',
        description='测试报告描述',
        tester='lym',
        stream=f,
        verbosity=2
    )
    runner.run(loader)
